package com.example.web_flux.config;

import com.example.web_flux.service.GoodsService;
import com.example.web_flux.service.OrderService;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author luo
 * @description
 * @since 2022/8/17 13:55
 */
@Configuration
public class ServiceConfig {

    @Qualifier("main")
    @Bean
    public OrderService orderService(){
        return new OrderService("main");
    }

    @Qualifier("second")
    @Bean
    public OrderService secondOrderService(){
        return new OrderService("second");
    }

    @Qualifier("main")
    @Bean("goodsServiceName")
    public GoodsService goodsService(){
        return new GoodsService("maing1");
    }

    @Qualifier("main2")
    @Bean
    public GoodsService goodsService2(){
        return new GoodsService("maing2");
    }


    @Qualifier("second")
    @Bean
    public GoodsService secondGoodsService(){
        return new GoodsService("second");
    }

}
